// 'Hello word' 可以作为类型使用，称为字面量类型
const message: 'Hello word' = 'Hello word'

// 字面量类型的意义，就是必须结合联合类型
type Alignment = 'left' | 'right' | 'center'

let align: Alignment = 'left'
align = 'right'
align = 'center'

// align = '123'


// 字面量推理

type Method = "GET" | 'POST'

type Request = {
    url: string,
    name: Method
}
const method: Request = {
    url: 'www.baidu.com',
    name: 'GET'
}
function request(url: string, name: string) {
    
}

request(method.url, method.name)

export {}